﻿using TMPro;
using UnityEngine;

namespace UnityView
{
    public class RichTextView : UILayout
    {
        public readonly TextMeshProUGUI TextMeshPro;

        public RichTextView(UILayout parent, string name) : base(parent, name)
        {
            TextMeshPro = UIObject.AddComponent<TextMeshProUGUI>();
        }

        public string Text
        {
            set => TextMeshPro.text = value;
            get => TextMeshPro.text;
        }

        public float FontSize
        {
            set => TextMeshPro.fontSize = value;
            get => TextMeshPro.fontSize;
        }
    }
}
